package tasks;

import java.util.Iterator;
import java.util.LinkedList;

public class TaskList extends LinkedList<Taskable>{

	private static final long serialVersionUID = 1L;
	
	private String game;
	private String absPath;
	private long totalSize;

	public TaskList(String game, String absPath) {
		super();
		this.game = game;
		this.absPath = absPath;
		this.totalSize = 0;
	}
	
	public void addToSize(long size){
		totalSize += size;
	}
	
	public long getTotalSize(){
		return totalSize;
	}

	public String getGame() {
		return game;
	}
	

	public String getAbsPath() {
		return absPath;
	}
	
	@Override
	public String toString() {
		String result = "[";
		Iterator<Taskable> it = this.iterator();
		while(it.hasNext()){
			Taskable next = it.next();
			if(next!=null) result += next.toString() + ",";
		}
		if(result.length()>1) {
			result = result.substring(0, result.length()-1);
		}
		result += "]";
		return result;
	}
}
